package com.chinacoal.microservice;

import com.chinacoal.microservice.fallback.CostFactorTemplateClientFallback;
import com.chinacoal.microservice.pojo.CcmsSmartleasingCoefficientTemplate;
import com.chinacoal.microservice.pojo.CcmsSmartleasingRoom;
import com.chinacoal.microservice.util.QueryCriteria;
import com.chinacoal.microservice.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author zhuliang
 * @version V1.0
 * @Description: 费用系数模板-对外开发的接口类
 * @date 2020-12-4 17：33
 */
@FeignClient(name = "${spring.application.name}",fallback = CostFactorTemplateClientFallback.class,configuration = FeignAutoConfiguration.class)
@Api(tags = {"费用系数模板"})
public interface CostFactorTemplateClient {

    /**
     * @Description: 查询所有的费用系数信息(带分页)
     * @author zhuliang
     * @date 2020/11/25 20:17
     */
    @ApiOperation(value = "查询所有的费用系数信息(带分页)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "queryCriteria", value = "查询条件", required = true, dataType = "QueryCriteria"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @PostMapping("smartleasing/coefficientTemplate/getAllCostTemplate")
    public Result<List<CcmsSmartleasingCoefficientTemplate>> getAllCostTemplate(@RequestBody QueryCriteria queryCriteria,
                                                                                @RequestHeader("token") String token);

    /**
     * @Description: 根据费用系数信息id查询费用系数信息
     * @author zhuliang
     * @date 2020/11/25 20:47
     */
    @ApiOperation(value = "根据费用系数信息id查询费用系数信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "pkCoefficientTemplateId", value = "费用系数信息id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "path", name = "status", value = "详情：0，修改：1", required = true, dataType = "Integer"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @GetMapping("smartleasing/coefficientTemplate/getCostTemplateById/{pkCoefficientTemplateId}/{status}")
    public Result<CcmsSmartleasingCoefficientTemplate> getCostTemplateById(@PathVariable(value = "pkCoefficientTemplateId") String pkCoefficientTemplateId,
                                                                           @PathVariable("status") Integer status,
                                                                           @RequestHeader("token") String token);

    /**
     * @Description: 根据费用系数信息id关闭费用系数
     * @author zhuliang
     * @date 2020/11/26 9:44
     */
    @ApiOperation(value = "根据费用系数信息实体,关闭费用系数")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "pkCoefficientTemplateId", value = "费用系数信息id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @GetMapping("smartleasing/coefficientTemplate/closeCoefficient/{pkCoefficientTemplateId}")
    public Result closeCoefficient(@PathVariable(value = "pkCoefficientTemplateId") String pkCoefficientTemplateId,
                                   @RequestHeader("token") String token);

    /**
     * @Description: 添加费用系数模板信息
     * @author zhuliang
     * @date 2020/11/26 10:04
     */
    @ApiOperation(value = "添加费用系数模板信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "coefficientTemplate", value = "费用系数信息实体", required = true, dataType = "CcmsSmartleasingCoefficientTemplate"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @PostMapping("smartleasing/coefficientTemplate/addCoefficient")
    public Result addCoefficient(@RequestBody CcmsSmartleasingCoefficientTemplate coefficientTemplate,
                                 @RequestHeader("token") String token);

    /**
     * @Description: 费用系数模板的关联房间
     * @author zhuliang
     * @date 2020/11/26 18:15
     */
    @ApiOperation(value = "费用系数模板的关联房间")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "path", name = "pkCoefficientTemplateId", value = "费用系数信息id", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @GetMapping("smartleasing/coefficientTemplate/modifyTheAssociatedRoom/{pkCoefficientTemplateId}")
    public Result<List<CcmsSmartleasingRoom>> modifyTheAssociatedRoom(@PathVariable(value = "pkCoefficientTemplateId") String pkCoefficientTemplateId,
                                                                      @RequestHeader("token") String token);

    /**
     * @Description: 修改费用信息
     * @author zhuliang
     * @date 2020/12/14 14:48
     */
    @ApiOperation(value = "修改费用信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "coefficientTemplate", value = "费用系数模型实体类", required = true, dataType = "CcmsSmartleasingCoefficientTemplate"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @PutMapping("smartleasing/coefficientTemplate/updateCoefficientTemplate")
    public Result<CcmsSmartleasingCoefficientTemplate> updateCoefficientTemplate(@RequestHeader("token") String token,
                                                                                 @RequestBody CcmsSmartleasingCoefficientTemplate coefficientTemplate);

    /**
     * @Description: 查询所有的费用系数模板消息
     * @author zhuliang
     * @date 2020/11/30 19:16
     */
    @ApiOperation(value = "查询所有的费用系数模板消息(房间用)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @GetMapping("smartleasing/coefficientTemplate/getAllByCoefficient")
    public Result<List<CcmsSmartleasingCoefficientTemplate>> getAllByCoefficient(@RequestHeader("token") String token);

    /**
     * @Description: 条件查询费用系数模板信息(带分页)
     * @author zhuliang
     * @date 2020/11/26 18:35
     */
    @ApiOperation(value = "条件查询费用系数模板信息(带分页)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "queryCriteria", value = "查询条件实体", required = true, dataType = "QueryCriteria"),
            @ApiImplicitParam(paramType = "header", name = "token", value = "令牌", required = true, dataType = "String")
    })
    @PostMapping("smartleasing/coefficientTemplate/conditionalQueryCoefficient")
    public Result<List<CcmsSmartleasingCoefficientTemplate>> conditionalQueryCoefficient(@RequestBody QueryCriteria queryCriteria,
                                                                                         @RequestHeader("token") String token);
}
